#pragma once
#ifndef GRAPHIC_PLUGIN_INCLUDED
#define GRAPHIC_PLUGIN_INCLUDED

#include "shared\module_common.h"
#include <string>

// we need to #define to use the name from other DLLs
// (otherwise they would need to link to this DLL)
#define GRAPHIC_PLUGIN_MODULE_NAME_BASE "GraphicPlugin"

class ProductionJobData;
class CBitmapExData;
class GraphicPluginImpl;
struct ExtractionAreas;
struct ExtractionObject;

class GraphicPlugin : public ModuleBase
{
private:
	boost::shared_ptr<GraphicPluginImpl> pImpl;
public:

	GraphicPlugin(void);
	virtual ~GraphicPlugin(void);
	virtual void getModuleInfo( OUT MODULE_INFO &ModuleInfo ) const;

	// custom functions of GraphicPlugin
	virtual result initGraphicPlugin(
		IN const char *pszInput,
		OUT std::string &strPluginInfo );

	virtual result queryPlaneInfo(
		IN const char *pszPlane,
		OUT std::string &strPlaneInfo );

	virtual result startPage( 
		IN jobid_t ProductionJobId, 
		IN ProductionJobData &pjd,          // can be stored for JobId
		IN const char *pszPlane,
		INOUT CBitmapExData &PlaneBitmap    // just for convenience: is in pjd
	);

	virtual result processArea(
		IN jobid_t ProductionJobId, 
		IN ExtractionObject &Object,
		IN const char *pszArea,
		INOUT CBitmapExData &PlaneBitmap,   // just for convenience: is in pjd( JobId )
		OUT std::string &strResult
		);

	virtual result endDocument( IN jobid_t ProductionJobId );

	virtual result preprocessAreas(
		IN jobid_t ProductionJobId,
		IN const char *pszPlane,
		IN const char *pszProfile,
		INOUT ExtractionAreas &Areas );

	// $TODO $MS: Check if we need support for multiple planes in one graphic
    //            plugin. If so, we need a function querySupportedPlanes().
};

#endif // GRAPHIC_PLUGIN_INCLUDED
